﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="JobData.aspx.cs" Inherits="AzureMRUI.JobData" %>
<%@ Import Namespace="AzureMRUI" %>
<%@ Import Namespace="Microsoft.WindowsAzure.StorageClient" %>

<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style2 { width: 105px; }

        .style4 {
            width: 139px;
            height: 21px;
        }

        .style5 {
            width: 105px;
            height: 21px;
            font-weight: bold;
        }

        .style6 {
            width: 80px;
            height: 21px;
            font-weight: bold;
        }

        .style8 {
            width: 97px;
            height: 21px;
            font-weight: bold;
        }

        .style10 { font-size: small; }

        .style11 {
            font-size: small;
            font-family: "Courier New", Courier, monospace;
        }

        .style12 { width: 80px; }

        .style13 { width: 22px; }

        .style14 {
            width: 22px;
            height: 21px;
            font-weight: bold;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Label ID="Label1" runat="server" 
               style="font-weight: 700;" Text="JobID :" Width="61px" CssClass="style10"></asp:Label>
    <asp:Label ID="Label2" runat="server" 
               style="font-weight: 700" CssClass="style10"></asp:Label>
    <br />
    <table style="width: 90%;">
        <tr>
            <th class="style4">
            </th>
            <th class="style5">
                Total Tasks</th>
            <th class="style6">
                Pending Tasks</th>
            <th class="style14">
                Executing Tasks</th>
            <th class="style8">
                Finished Tasks</th>
            <th >%
            </th>
        </tr>
        <tr>
            <td >
                Map Tasks</td>
            <td >
                <asp:Label ID="MapTotalLabel" runat="server"></asp:Label>
            </td>
            <td class="style12" >
                <asp:Label ID="MapPendingLabel" runat="server"></asp:Label>
            </td>
            <td class="style13" >
                <asp:Label ID="MapExecutingLabel" runat="server"></asp:Label>
            </td>
            <td>
                <asp:Label ID="MapFinishedLabel" runat="server"></asp:Label>
            </td>
            <td>
                <asp:Label ID="MapPercentageComplete" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td >
                Reduce Tasks</td>
            <td >
                <asp:Label ID="ReduceTotalLabel" runat="server" Text="0"></asp:Label>
            </td>
            <td class="style12" >
                <asp:Label ID="ReducePendingLabel" runat="server" Text="0"></asp:Label>
            </td>
            <td class="style13" >
                <asp:Label ID="ReduceExecutingLabel" runat="server" Text="0"></asp:Label>
            </td>
            <td >
                <asp:Label ID="ReduceFinishedLabel" runat="server" Text="0"></asp:Label>
            </td>
            <td>
                <asp:Label ID="ReducePercentageComplete0" runat="server"></asp:Label>
            </td>
        </tr>
    </table>
    <br />
    <span class="style11"><strong>Current Iteration :<asp:Label ID="IterationLabel" runat="server"></asp:Label>
                              <br />
                              <br />
                              Start Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<asp:Label ID="StartTimeLabel" runat="server"></asp:Label>
                              <br />
                              <br />
                              Output Container&nbsp; :<asp:Label ID="OutContainerLabel" runat="server"></asp:Label>
                          </strong></span>
    <br />
    <%
        string outCont = Request.QueryString["outcontainer"];
        if (outCont != null)
        {
            DataSource datasource = new DataSource();
            List<IListBlobItem> list = datasource.GetBlobs(outCont);
            foreach (IListBlobItem blob in list)
            {%>
            <a href='<%= blob.Uri %>'><%= blob.Uri %></a> 
            <br />
    Program Params :
    <asp:Label ID="ProParamsLabel" runat="server"></asp:Label>
            <br />
    <%
            }
        }
%>
    <br />
    <asp:Chart ID="Chart2" runat="server" DataSourceID="ObjectDataSource1" 
               Width="680px">
        <series>
            <asp:Series Name="Series1" YValueMembers="MapTaskTime">
            </asp:Series>
        </series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1">
                <axisx maximum="100"  title="Map Task Index">
                </axisx>
                <axisy title="Task Time (ms)"></axisy>
            </asp:ChartArea>
        </chartareas>
    </asp:Chart>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                          SelectMethod="GetMapTasks" TypeName="AzureMRCore.DataModel.MapTaskDataSource">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="" Name="jobID" QueryStringField="JobID" 
                                      Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <br />
</asp:Content>